<template>
    <view class="cardbox">
        <view>
            <view class="card">
                <view class="card_center">
                    <image class="person" :src="$mConfig.imageUrl + '/image/icon-head.png'"></image>
                    <view style="margin-left:26rpx">
                        <text>张妹妹</text>
                        <text>548758956258963251</text>
                    </view>
                    <image :src="$mConfig.imageUrl + '/image/rz.png'" class="rz"></image>
                </view>
                <view class="class_footer">
                    <text>个人隐私信息安全保障</text>
                    <text @click="ruleBtn">隐私政策 <text class="yzb yzb-next icon-next"></text></text>
                </view>
            </view>
            <view class="lists">
				<view class="itemOne" @tap="handFun">
					<text class="name">证件信息</text>
					<text class="yzb yzb-next icon-next"></text>
				</view>
				<view class="itemOne" @tap="photoHand">
					<text class="name">证件照片</text>
					<text class="yzb yzb-next icon-next"></text>
				</view>
			</view>
        </view>
    </view>
</template>

<script>
// import {
//     home
// } from "../../../../components/common/images";
// import {
//     merchantAuthenticationDetail,
//     getUserCertificationDetail
// } from "../../../../services/api.js"
// import { errorCallback } from "../../../../utils/common"
export default {
    name: "qYCertification",
    data() {
        return {
            // officialCertification: home.officialCertification,
            // SMRenZhengBg: home.SMRenZhengBg,
            // SMRenZhengCard: home.SMRenZhengCard,
            // person: home.person,
            // youJianTou: home.youJianTou,
            companyName: '',
            registerNo: '',
            id: -1,
            isRealName: 0
        }
    },
    onLoad(options) {
        // 到这个页面的都是认证通过的
        // 处理标题
        if (options.isRealName) {
            this.isRealName = options.isRealName
        } else {
            this.id = options.id
            if (options.id == 2) {
                uni.setNavigationBarTitle({
                    title: "城市代理认证",
                })
            } else if (options.id == 3) {
                uni.setNavigationBarTitle({
                    title: "二手车商认证",
                })
            }
        }
        // this.getContent()
    },
    methods: {
        ruleBtn() {
            let url = 'https://oss.benbenhuanche.com/wap/article/20220331/1509480643661172737.html';
            uni.navigateTo({
                url: '/pages/mine/set/ruleweb?url=' + url
            })
        },
        getContent() {
            if (this.isRealName == 1) {
                getUserCertificationDetail().then(obj => {
                    this.res = obj.result
                    // 企业名称
                    this.companyName = this.res.realName
                    // 营业执照注册号
                    this.registerNo = this.res.idcardNo
                }).catch(errorCallback)
            } else {
                merchantAuthenticationDetail().then(obj => {
                    this.res = obj.result
                    // 企业名称
                    this.companyName = this.res.operatorName
                    // 营业执照注册号
                    this.registerNo = this.res.registerNo
                }).catch(errorCallback)
            }
        },
        handFun() {
          console.log('点击跳转')
            uni.navigateTo({
                url: '/pages/user/renzheng/userInformation'
            })
        },
        photoHand() {
            uni.navigateTo({
               url: '/pages/user/renzheng/certificatePhoto'
            })
        }
    }
}
</script>

<style lang="scss">
.cardbox{
  padding: 30rpx;
  .card{
    background: #446D9F;
    border-radius: 20rpx;
    padding: 34rpx 16rpx 36rpx 38rpx;
    position: relative;
    .person{
      width: 122rpx;
      height: 122rpx;
      border-radius: 50%;
    }
    .rz{
      width: 164rpx;
      height: 144rpx;
      position: absolute;
      right: 0;
      top:0
    }
  }

}
    .card_center {
        height: 169rpx;
        display: flex;
        align-items: center;
        position: relative;
        color: #fff;

        view {
            display: flex;
            flex-direction: column;
             font-weight: bold;
            text:nth-of-type(1) {
                font-size: 32rpx;
            }
            text:nth-of-type(2) {
                font-size: 28rpx;
                font-weight: 500;
                margin-top: 20rpx;
            }
        }
    }

    .class_footer {
        margin: 73rpx auto 0 auto;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 26rpx;
        color: #fff;
        position: relative;
        .yzb{
          font-weight: bolder;
              font-size: 36rpx;
        }
    }

    .lists {
        top: 104rpx;
        .itemOne {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid #F1F1F1;
            height: 116rpx;
            .name{
              color: #222;
              font-size: 32rpx;
              font-weight: bold;
            }
            .yzb{
              font-weight: bolder;
              color: #ccc;
              font-size: 44rpx;
            }
        }
    }
</style>
